﻿using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Infrastructure.ApllicationDto.Enums;

namespace Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage
{
    public class TracesInfoDto : PageResultDto
    {
        public long ID { get; set; }

        public string Js_Id { get { return ID.ToString(); } }
        /// <summary>
        /// 用户ID
        /// </summary>
        public long UserID { get; set; }
        /// <summary>
        /// 用户名 
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime LogTime { get; set; }



        private const string DATE_STRING_FORMAT = "yyyy-MM-dd HH:mm:ss";
        private readonly DateTime defaultTime = new DateTime(1900, 1, 1);

        public string LogTimeFormat
        {
            get
            {
                if (LogTime <= defaultTime)
                {
                    return "";
                }

                return LogTime.ToString(DATE_STRING_FORMAT);
            }
        }


        /// <summary>
        /// 登录Ip 
        /// </summary>
        public string Ip { get; set; }
        /// <summary>
        /// 操作类型 1=登录 2=新增 3=修改 4=删除 5=查看 6=审核
        /// </summary>
        public int OperationType { get; set; }


        /// <summary>
        /// 调度类型说明
        /// </summary>
        public string OperationTypeDescription
        {
            get
            {
                var result = ((EnumOperationType)Enum.Parse(typeof(EnumOperationType), OperationType.ToString())).ToString();
                return result;
            }
        }
        /// <summary>
        /// 功能ID
        /// </summary>
        public long FunctionID { get; set; }
        /// <summary>
        /// 功能名称
        /// </summary>
        public string FullName { get; set; }
        /// <summary>
        /// 操作页面
        /// </summary>
        public string RequestUrl { get; set; }
        /// <summary>
        /// 请求参数
        /// </summary>
        public string Parameter { get; set; }
        public string StarTime { get; set; }
        public string EndTime { get; set; }
    }
}
